package vip.xumy.admin.um.pojo;

import java.text.MessageFormat;
import java.util.List;

import com.alibaba.fastjson.annotation.JSONField;

import lombok.Getter;
import lombok.Setter;
import vip.xumy.core.pojo.base.BasePageParam;
import vip.xumy.core.utils.StringUtil;

/**	Ownership belongs to the company
 *	author:mengyxu
 *	date:2019年5月10日
 * 	The entity for table UserManagement
 */

@Setter
@Getter
public class User extends BasePageParam {

	private String userId;
	private String key;
	private String name;
	private String phone;
	private String idCard;
	private String email;
	private String lastLogin;
	private String status;
	
	private String newKey;
	
	private List<String> roles;
	
	public String briefInfo() {
		return MessageFormat.format("用户名:{0},姓名:{1},手机号码:{2},用户角色:{3}", userId, name, phone, roles);
	}
	
	@JSONField(serialize = false)
	public boolean isEmpty(){
		if(StringUtil.isEmpty(userId)) {
			return true;
		}
		if(roles == null) {
			return true;
		}
		if(roles.isEmpty()) {
			return true;
		}
		return false;
	}
	
}